﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CLibArtreve.security;

namespace WebAppArtreve.views.shared.components.security
{
    public partial class WUCLoggedInAs : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                RenderName();
            }
        }

        protected void RenderName()
        {
            if (!Context.User.Identity.IsAuthenticated)
                return;
            //GET USER IDENTITY
            ArtreveIdentity identity = (ArtreveIdentity)Context.User.Identity;
            //WRITE NAME
            this.lblName.Text = identity.User.Nickname;
        }
    }
}